package io.renren.modules.archive.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import io.renren.modules.sys.entity.SysMenuEntity;
import lombok.Data;
import org.jetbrains.annotations.NotNull;

/**
 * ${comments}
 * 
 * @author lizeliang
 * @email 2749877017@qq.com
 * @date 2023-08-29 13:06:15
 */
@Data
@TableName("ARCHIVE_COLLECT")
public class ArchiveCollectEntity implements Serializable,Comparable<ArchiveCollectEntity> {
	private static final long serialVersionUID = 1L;

	/**
	 * $column.comments
	 */
	@TableId
	private Long menuId;
	/**
	 * $column.comments
	 */
	private Long parentId;
	/**
	 * $column.comments
	 */
	private String name;
	/**
	 * $column.comments
	 */
	private String value;
	/**
	 * $column.comments
	 */
	private String url;
	/**
	 * $column.comments
	 */
	private String perms;
	/**
	 * $column.comments
	 */
	private Integer type;
	/**
	 * $column.comments
	 */
	private String icon;
	/**
	 * $column.comments
	 */
	private Integer orderNum;
	/**
	 * $column.comments
	 */
	private String  level;
	/**
	 * ztree属性
	 */
	@TableField(exist=false)
	private Boolean open;

	@TableField(exist=false)
	private List<ArchiveCollectEntity> list=new ArrayList<>();


	@Override
	public int compareTo(@NotNull ArchiveCollectEntity o) {
		return this.getOrderNum()-o.getOrderNum();
	}

	public boolean isLeaf() {
		return list == null || list.isEmpty();
	}

	/**
	 * 父菜单名称
	 */
	@TableField(exist=false)
	private String parentName;

}
